package org.neuedu.chapter07_0623.demo06;

public class Zoombie {
    public void attack(Plant plant) {
        System.out.println("僵尸攻击了"+plant.getName());
    }

    public static void main(String[] args) {
        Zoombie zoombie = new Zoombie();

        BeanHunter beanHunter = new BeanHunter();
        beanHunter.setName("大豆");

        SunFlower sunFlower = new SunFlower();
        sunFlower.setName("大花");

        zoombie.attack(beanHunter);
        zoombie.attack(sunFlower);
    }
}
